import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/home.vue'),
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('../views/index.vue')
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('../views/about.vue')
      },
      {
        path: '/product',
        name: 'product',
        component: () => import('../views/product.vue')
      },
      {
        path: '/news',
        name: 'news',
        component: () => import('../views/news.vue'),
      },
      {
        path: '/newsDetail',
        name: 'newsDetail',
        component: () => import('../views/detail/newDetail.vue')
      },
      {
        path: "/addWe",
        name: "addWe",
        component: () => import("../views/addWe.vue")
      }
    ]
  },
]


const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
export default router
